# -*- coding: utf-8 -*-
from db.mysql import MysqlClient
from common.helper import Helper
class Arrangement( object ):
    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "昆仑健康保重大疾病保险（2.0版）"

    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):
            if item["interval"] == "0":
                payType = "一次交清"
            else:
                payType = "年交"
            data["name"] = self.name
            data["company"] = "昆仑健康保险"
            data["year"] = item["year"]
            data["gender"] = "1" if item["gender"] == "0" else "0"
            data["money"] = str(int(int(item["money"])/10000)) + "w"
            data["expire"] = item["expire"]
            data["interval"] = item["interval"]
            data["payType"] = payType
            data["seriousDeath"] = item["death"]
            data["seriousCancer"] = item["cancer"]
            data["seriousMedical"] = item["serious"]
            data["specialAdult"] = item["adult"]
            data["price"] = item["price"]
            Helper.mergeTable( self.name,self.mysql,data )
